package com.config.service.impl;

import com.config.dao.UserDao;
import com.config.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
//@Service该注解===@Component，， @Service语义性更强

//1对象名默认为类型首字母小写
//2.基于注解  @Service("userService")

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    //@Autowired 自动写入注解，spring会在容器自动查找与该注解属性名字或者类型一致的注解
    public UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void add() {
        System.out.println("userServiceImpl==>add");
        userDao.add();
    }
}
